<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
pc_base::load_sys_class('form','',0);

class setting extends admin {
	private $settingDb;
	function __construct() {
        parent::__construct();
		$this->settingDb = pc_base::load_model('epaper_setting_model');
	}
	
	public function index() {
		
		$auto_grab = safe_replace($_GET['auto_grab']??'');
		
		$one = $this->settingDb->get_one(['name'=>'自动抓取']);

		include $this->admin_tpl('setting');
    }

	public function set() {

		$auto_grab = safe_replace($_POST['auto_grab']??'');

		$one = $this->settingDb->update(['value'=>$auto_grab], ['name'=>'自动抓取']);

		showmessage(L('operation_success'),HTTP_REFERER);

    }

}
